package com.example.demo.controller;

import com.example.demo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.lang.reflect.Array;
import java.util.Arrays;

@Controller
public class HelloController {
    @Autowired
    private  Person person;

    @GetMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello"+person.getName()+",我的爱好:"+ Arrays.toString(person.getHobby().toArray())+",出生日期："+person.getBirthday();
    }
}
